-
Notifications
You must be signed in to change notification settings - Fork 22
NETOBSERV-2437: Active since field added to alert details #1129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@leandroberetta: This pull request references NETOBSERV-2437 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
web/src/utils/datetime.ts
Outdated
| * - Last 7 days: Shows day of week and time (Tue, 14:23) | ||
| * - Older: Shows full date and time (2025-11-24 14:23) | ||
| */ | ||
| export const formatActiveSince = (timestamp: string): string => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one deserves a unit test
I think there's a bug in "yesterday" : activeDate.getDate() === yesterday.getDate()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I added a unit test. It passed.
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #1129 +/- ##
==========================================
- Coverage 53.60% 47.36% -6.24%
==========================================
Files 205 40 -165
Lines 10513 2825 -7688
Branches 1301 0 -1301
==========================================
- Hits 5635 1338 -4297
+ Misses 4362 1318 -3044
+ Partials 516 169 -347
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
e0ac264 to
ba0058a
Compare
jotak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, LGTM!
| * Formats a timestamp for "Active since" display with relative or absolute time. | ||
| * - Today: Shows only time (14:23) | ||
| * - Yesterday: Shows "Yesterday, HH:MM" | ||
| * - Last 7 days: Shows day of week and time (Tue, 14:23) | ||
| * - Older: Shows full date and time (2025-11-24 14:23) | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, you have a point, consistency
@jotak @jpinsonneau is there any helper to format the time between plugins?.
For the sake of consistency I can adapt the date to that format, wdyt?.

Description
Active since field added to alert details.
How to test
Enable the experimental mode:
Then enable, for example DNSTracking:
Finally, create a pod that generates dns errors:
Dependencies
n/a
Checklist
If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.